﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Lilium.UI
{
    public class UIState2<TControl>
    {
        public UIState2(Func<IViewport, TControl> provider)
        {
            if (provider == null) throw new ArgumentNullException("provider");

            m_Provider = provider;
        }

        public TControl RunUI(IViewport viewport)
        {
            if (viewport == null) throw new ArgumentNullException("viewport");

            return Provider(viewport);
        }

        #region private Func<IViewport, TControl> Provider

        private readonly Func<IViewport, TControl> m_Provider;

        private Func<IViewport, TControl> Provider { get { return m_Provider; } }

        #endregion
    }
}